import request from '@/utils/request'

// 云当铺app商城1.1版本：提交售后
/**
 * 
 订单号 orderCode;
 服务类型 0仅退款1退货退款 serviceType;
 申请原因 reasonForApplication;
 申请说明 applicationInstructions;
 申请说明图片 applicationDescriptionPicture;
 商品数据 productParamList;
 */
export function submitAfterSealsOrder(data) {
  return request.post(`/sy/shop/applyForAfterSales`, data, {
	  login: true
  });
}

// 云当铺app商城1.1版本：售后订单列表
export function getAfterSealsList (params) {
	return request.get('/sy/shop/storeAfterSales/list', params, {
	  login: true,
	});
}

// 云当铺app商城1.1版本：查询订单
export function getAfterSealsDetail (key, id) {
  return request.get(`/sy/shop/store/detail/${key}/${id}`)
}


// 云当铺app商城1.1版本：撤销售后订单
export function rebackAfterSeals (key, id) {
  return request.get(`/sy/shop/revoke/${key}/${id}`)
}

// 云当铺app商城1.1版本：获取物流信息
export function getExpressData () {
  return request.get('/sy/shop/yxExpress')
  
}


// 云当铺app商城1.1版本：添加快递单号
export function addExpressData (params) {
  return request.post('/sy/shop/addLogisticsInformation?'+`code=${params.code}&name=${params.name}&postalCode=${params.postalCode}&orderCode=${params.orderCode}&id=${params.id}&`, '', {
	  login: true
  })
}

// 售后详情
export function getAfterSalesDeatail(key) {
  return request.get(`/applyForAfterSales/${key}`);
}

// 搜索
export function searchAfterSealsDetail (key) {
  return request.get(`/store/detail/${key}`)
}


// 删除售后订单
export function deleteAfterSeals (params) {
  return request.delete('/deleteAfterSalesOrder', params, {
	  login: true
  })
}
